/*
 * 07指针作为函数返回值.c
 *
 *  Created on: 2024年3月9日
 *      Author: HP
 */
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<time.h>

char* my_strchar(char* str, char ch){
	int i = 0;
	while(str[i]){
		if(str[i] == ch){
			return &str[i];
		}
		i++;
	}
	return NULL;
}

char* my_strchar2(char* str, char ch){
	while(*str){
		if(*str == ch){
			return str;
		}
		str++;
	}
	return NULL;
}

int main0607(){
	char ch[] = "hello world";
	char* p = my_strchar2(ch, 'o');
	if(p == NULL){
		printf("未找到\n");
	}else{
		printf("%s\n", p);
	}
	return 0;
}
